Ext.define('TS.view.bible.bibleverse.Grid' , {
	extend: 'TS.lib.Grid',
	alias : 'widget.bibleversegrid',
	tbar:Factory.toolbar.search([{
		name:'bible_id',
		xtype:'combo',
		store:Dict.bible,
		empty:'Tłumaczenie'
	},{
		name:'bible_verse_text',
		xtype:'text',
		empty:'Fraza',
		searchTpl:'%{x}%',
		searchSign:'like'
	},{
		name:'book_id',
		empty:'Księga',
		onSelect:function(){
			var c = this.up('toolbar').down('combo[name=chapter_id]');
			c.clearValue();
			Util.s.load(c.getStore(),where('book_id',this.getValue()));
		},
		xtype:'combo',
		store:Dict.book
	},{
		name:'chapter_id',
		empty:'Rozdział',
		xtype:'combo',
		store:Dict.chapter
	}]),
	frame:false,
	store: 'BibleVerse',
	columns: [
	 	{xtype: 'rownumberer'},{
			header:'ID',
			hidden:true,
			dataIndex:'bible_verse_id'
		},{
			header:'Treść',
			sortable:true,
			dataIndex:'bible_verse_text'
		},{
			header:'Biblia',
			renderer:Factory.rend.dict(Dict.bible),
			dataIndex:'bible_id'
		},{
			header:'Wers',
			sortable:true,
			dataIndex:'verse_number',
			renderer:function(v,x,s){
				return Factory.rend.loose_dict(s.data.verse_id,Dict.verse);
			}
		}
	]
});